/**
*@class Iictool
*@brief "Static" class for uniform access to i2c device
*@author Brecht Roose
*@date 04-2011
*
* @section source Sources
* i2c-dev.h, i2cbusses.h
*
* @section working What does the code
* Data sturen en krijgen via een i2c bus.
*
* @section destination Destination
* IR
*
*  Created by Brecht Roose on 17/02/11.
*  Copyright 2011 Denayer Instituut. All rights reserved.
*
*/

#ifndef IICTOOL_H
#define IICTOOL_H

#include "log.h"
#include <stdlib.h>
#include <string.h>
extern "C" {
    #include "i2c-dev.h"
    #include "i2cbusses.h"
}

class Iictool
{
public:
    Iictool(string iic_address);
    ~Iictool();                                     //destructor zonder parameters!
    int iicSet(string chip_address, string data_address, string value);
    //int iicGet(string chip_address, string data_address);
    char iicGet(string chip_address, string data_address);
    string logstring_;

private:
    //private var altijd eindigen met _
//string voor logger
    Log *logger_;
    long iic_address_, chip_address_, data_address_, value_;
    int size_;
    int file_, res_;
    char *end_, filename_[20];

    void setIicAddress(string iic_address);
	void setChipAddress(string chip_address);
    void setDataAddress(string data_address);
    void setValue(string value);
};
#endif
